package org.raymond.icloud.apis.admin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import org.raymond.icloud.apis.admin.entity.enums.StateEnum;
import org.raymond.icloud.common.core.mybatis.entity.AbstractEntity;

import javax.validation.constraints.NotEmpty;

/**
 * @author raymond
 * @version V1.0
 * @Description: TODO
 */
@Data
@Builder
@EqualsAndHashCode(onlyExplicitlyIncluded=true, callSuper = false)
@TableName("t_sys_role")
public class TSysRole extends AbstractEntity {
    @ApiModelProperty(name="id", value = "角色Id", dataType="Long")
    @EqualsAndHashCode.Include
    @TableId(value="id", type= IdType.ASSIGN_ID)
    private Long id;

    @ApiModelProperty(name="name", value = "角色名称", dataType="String")
    @NotEmpty(message = "name不能为空")
    @TableField("name")
    private String name;

    @ApiModelProperty(name="code", value = "角色编码", dataType="String")
    @NotEmpty(message = "code不能为空")
    @TableField("code")
    private String code;

    @ApiModelProperty(name="parentId", value = "父级Id", dataType="Long")
    @TableField("parent_id")
    private Long parentId;

    @ApiModelProperty(name="state", value = "状态, 0-停用, 1-正常", dataType="Integer")
    @TableField("state")
    private StateEnum state;
}
